Skip to content

com.inscoper.api.Image

Image class represents an image with associated metadata. More...

Public Functions

Name
synchronized void delete()
Image(UCharVector imageData, MetadataMap metadata)
Constructor.
long getPixelSize()
Get the pixel size.
long getBitDepth()
Get the image bit depth.
long getWidth()
Get the image width.
long getHeight()
Get the image height.
EPixelType getPixelType()
Get the pixel type.
Object getImageData()
Get the image data.
boolean hasMetadata(String name)
Check if a metadata exists.
void addMetadata(String name, Metadata value)
Add or update a metadata.
void removeMetadata(String name)
Remove a metadata.
MetadataMap getMetadata()
Get all metadata.
Metadata getMetadata(String key)
Get a metadata.
void setMetadata(MetadataMap metadata)
Set all metadata.

Protected Functions

Name
Image(long cPtr, boolean cMemoryOwn)
void swigSetCMemOwn(boolean own)
void finalize()
long getCPtr(Image obj)

Detailed Description

public class com.inscoper.api.Image;

Image class represents an image with associated metadata.

This class encapsulates raw image data associated with metadata, providing methods to access pixel properties, dimensions, and metadata.

Public Functions Documentation

function delete

public synchronized void delete()

function Image

public Image(
    UCharVector imageData,
    MetadataMap metadata
)

Constructor.

Parameters:

  • imageData : The raw bytes of the image
  • metadata : A map pairing metadata keys with values

Initializes a new instance of the Image class with raw data and metadata.

function getPixelSize

public long getPixelSize()

Get the pixel size.

Return: The pixel size in bytes

Retrieves the size of a single pixel in bytes.

function getBitDepth

public long getBitDepth()

Get the image bit depth.

Return: The bit depth of the image

Retrieves the bit depth of the image (e.g., 8, 16 bits).

function getWidth

public long getWidth()

Get the image width.

Return: The width of the image in pixels

Retrieves the width of the image in pixels.

function getHeight

public long getHeight()

Get the image height.

Return: The height of the image in pixels

Retrieves the height of the image in pixels.

function getPixelType

public EPixelType getPixelType()

Get the pixel type.

Return: The pixel type

Retrieves the format of the pixels (bit depth and gray/rgb).

function getImageData

public Object getImageData()

Get the image data.

Return: The image data

Retrieves the raw image data.

function hasMetadata

public boolean hasMetadata(
    String name
)

Check if a metadata exists.

Parameters:

  • name : The name of the metadata to check

Return: True if the metadata exists, false otherwise

Determines if a specific metadata exists in the image.

function addMetadata

public void addMetadata(
    String name,
    Metadata value
)

Add or update a metadata.

Parameters:

  • name : The name of the metadata
  • value : The metadata value to store

Inserts a new metadata or updates an existing one.

function removeMetadata

public void removeMetadata(
    String name
)

Remove a metadata.

Parameters:

  • name : The name of the metadata to remove

Exceptions:

Deletes a metadata.

function getMetadata

public MetadataMap getMetadata()

Get all metadata.

Return: The map pairing metadata keys with values

Retrieves all metadata associated with the image.

function getMetadata

public Metadata getMetadata(
    String key
)

Get a metadata.

Parameters:

  • key : The name of the metadata

Exceptions:

Return: The metadata value

Retrieves a metadata.

function setMetadata

public void setMetadata(
    MetadataMap metadata
)

Set all metadata.

Parameters:

  • metadata : The new map pairing metadata keys with values

Replaces all current metadata.

Protected Functions Documentation

function Image

protected Image(
    long cPtr,
    boolean cMemoryOwn
)

function swigSetCMemOwn

protected void swigSetCMemOwn(
    boolean own
)

function finalize

protected void finalize()

function getCPtr

protected static long getCPtr(
    Image obj
)

Updated on 2026-04-02 at 10:55:37 +0200